<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>组件基本事例</title>
</head>
<body>
 
  <div id="components-demo">
    <button-counter></button-counter>
    <button-counter></button-counter>
  </div>
  <div id="app1">
    <blog-post title='111111'></blog-post>
    <blog-post title='222222'></blog-post>
    <blog-post title='333333'></blog-post>
  </div>
</body>
<script src="./vue1111.js"></script>
<script>
  Vue.component('button-counter',{
    data(){
      return {
        count:0
      }
    },
    template:`<button @click='count++'> You clicked me {{count}} times.</button>`
  });
  Vue.component('blog-post',{
    props: ['title'],
    template:`<h1> {{title}}</h1>`
  })
  new Vue({
    el:'#components-demo'
  });
  new Vue({
    el:'#app1'
  })
</script>
</html>